Class MyShortTrackFormatter


  • public class MyShortTrackFormatter
    extends MyTrackFormatter
    This class represents the concept of short formatting of a track containing only some information.
    Version:
    234
    Author:
    TeM, JS
    Stage:
    ES04
    Introduced in:
    ExerciseSheet04
    Programming problem category:
    abstract class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(Track t)
      Creates a short format of a track.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MyShortTrackFormatter

        public MyShortTrackFormatter()
    • Method Detail

      • format

        public java.lang.String format​(Track t)
        Creates a short format of a track.

        The short representation of a track is

         "title" "performer"
         

        (without quotes)
        Both title, and performer are exactly ten characters wide with leading blanks (if any).

        Specified by:
        format in class MyTrackFormatter
        Parameters:
        t - the track to be formatted
        Returns:
        the formatted String representing the track